package mhcs.client;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.PopupPanel;

public class LogMenuButton extends Button{
	public LogMenuButton(){
		super("Log Menu");
		final PopupPanel popup = new PopupPanel(true);
		popup.add(new AddModule());
		addClickHandler(new ClickHandler() {
			public void onClick(ClickEvent event) {
				popup.setPopupPositionAndShow(new PopupPanel.PositionCallback() {
					public void setPosition(int offsetWidth, int offsetHeight) {
						int left = (Window.getClientWidth() - offsetWidth) / 3;
						int top = (Window.getClientHeight() - offsetHeight) / 3;
						popup.setPopupPosition(left, top);
					}
				});
          }
        });

	}
}
